define(function() {
	return function($compile, $scope) {
		require([ "AppPathDir/account/accountGuideInfos/support",
				"AppPathDir/account/accountGuideInfos/add",
				"AppPathDir/account/accountGuideInfos/update",
				"AppPathDir/account/accountGuideInfos/delete" ], function(Support,
				AddSupport, UpdateSupport, delSupport, Util, Tool, Slidebar,
				inputSelect) {
			/* 查询 start */
			$scope.search = {};
			$scope.cache = {
				types: new Array(),
				typeMap: new Map()
			};
			$scope.searchSupport = {
				run : function() {
					$scope.gridFun();
				}
			};
			// 支付类型
			$.ajax({
				url : getServer() + "/flea/hclv/getPayType.htmls",
				success : function(data) {
                    if (data.status != 200) {
                        return;
                    }
					$scope.cache.types = data.data;
					$.each(data.data, function(index, row) {
						$scope.cache.typeMap.set(row.dictCode, row.dictName);
					});
					$scope.gridFun();

				}
			});
			$scope.gridFun = function() {
				// 表格数据
				$.ajax({
					url : getServer() + "/flea/hclv/qr/manage/selectByUserId.htmls",
					success : function(data) {
                        if (data.status != 200) {
                            return;
                        }
						$scope.grid.reload({
							data : data.data
						})
					}
				});
			}
			/* 查询 end */
			$scope.addSupport = AddSupport($scope, $compile);
			$scope.updateSupport = UpdateSupport($scope, $compile);
			$scope.delSupport = delSupport($scope, $compile);
			$scope.grid = Support.init($scope.cache, $scope.addSupport,
					$scope.updateSupport, $scope.delSupport,
					$scope.searchSupport);
		})
	}
});